package observe;

public class Client {

    public static void main(String[] args) {
        //创建被观察者
        WeatherData weatherData = new WeatherData();

        CurrentCondition currentCondition = new CurrentCondition();
        //注册观察者
        weatherData.registerObserve(currentCondition);
        weatherData.registerObserve(new Baidu());

        //更新数据
        weatherData.changeData(10f,80f,40.4f);

        weatherData.removeObserve(currentCondition);
        System.out.println("移除第一个观察者");
        weatherData.notifyObserve();

    }

}
